package com.vn.ducktohome.screen.play;

import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.vn.ducktohome.gamelogic.GameControl;

/**
 * Tham khao
 * @author hpit
 *
 */
public class Duck extends Image {
	private int i;
	private int R = 100;
	private int x0 = 200, y0 = 200;
	private int x, y;
	
	public Duck() {
		super(GameControl.getAtlas().findRegion("play/duck", 1));
		i = 0;
	}
	
	@Override
	public void act(float delta) {
		super.act(delta);
		i += 5;
		
		x = (int) (R * Math.sin(i / 360.0));
		y = (int) (R * Math.cos(i / 360.0));
		
		setPosition(x + x0, y + y0);
	}
}
